﻿@model IPaginationList

 <div class="@ViewData["container"]">
@{int index;
  if (Model.TotalCount > 0)
  {
     
      if (!Model.IsFirstGroup)
      {
          index = Model.IndexGroup.First() - 1;
    @Html.PaginationLink("«", index, new { @class = ViewData["prevclass"] });
      }
      
      foreach (int i in Model.IndexGroup)
      {
          if (i == Model.PageIndex)
          {
    <span class="@ViewData["currentclass"]">@i.ToString()</span>
          }
          else
          {
    @Html.PaginationLink(i.ToString(), i, new { @class = ViewData["pageclass"] });
          }
      }

      if (!Model.IsLastGroup)
      {
          index = Model.IndexGroup.Last() + 1;
    @Html.PaginationLink("»", index, new { @class = ViewData["nextclass"] });
      }
      
  }
}
</div>
